package com.qhg.saas_server.utils;

import org.springframework.stereotype.Component;

import javax.xml.crypto.Data;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

@Component
public class TimeUtils {

    DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");

    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    //LocalDatetime转String
    public String LocaldatetimeOffectDate(LocalDateTime localDateTime) throws ParseException {
            return formatter.format(localDateTime);
    }
}
